package day01.arrayutil;

import java.util.Scanner;

public class Chengji {
    int java;
    int c;
    int DB;

    public Chengji() {
    }

    public Chengji(int java, int c, int DB) {
        this.java = java;
        this.c = c;
        this.DB = DB;
    }

    public void getGrade(int java,int c,int DB){
        this.java=java;
        this.c=c;
        this.DB=DB;
        int sum=java+c+DB;
        System.out.println("总成绩是："+sum);
        double ave=sum/3;
        System.out.println("平均成绩是："+ave);
    }
    public static void main(String[] args) {


        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入Java成绩：");
        int java=scanner.nextInt();
        System.out.print("请输入c成绩：");
        int c=scanner.nextInt();
        System.out.print("请输入DB成绩：");
        int DB=scanner.nextInt();

Chengji chengji=new Chengji();
chengji.getGrade(java,c,DB);

    }

    /**
     * 获取
     * @return java
     */
    public int getJava() {
        return java;
    }

    /**
     * 设置
     * @param java
     */
    public void setJava(int java) {
        this.java = java;
    }

    /**
     * 获取
     * @return c
     */
    public int getC() {
        return c;
    }

    /**
     * 设置
     * @param c
     */
    public void setC(int c) {
        this.c = c;
    }

    /**
     * 获取
     * @return DB
     */
    public int getDB() {
        return DB;
    }

    /**
     * 设置
     * @param DB
     */
    public void setDB(int DB) {
        this.DB = DB;
    }

    public String toString() {
        return "Chengji{java = " + java + ", c = " + c + ", DB = " + DB + "}";
    }
}
